package com.example.feign;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.FeignConfiguration;
import com.example.entry.User;

@FeignClient(name = "EUREKA-CLIENT", fallback = FeignClientFallback.class, configuration = FeignConfiguration.class)
public interface FeignEureKaClient {

	@GetMapping("/hello")
	String helloService();

	@RequestMapping("/getUser/{id}")
	public User getUser(@PathVariable("id") int id);

	@GetMapping(value = "/getList")
	public List<User> getList();

	@PostMapping(value = "/addUser")
	public User addUser(@RequestBody User user);
}
